home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / MATH / MATH1 / RANDOM.PAS < prev    next >
Pascal/Delphi Source File  |  1985-04-03  |  384b  |  26 lines

  1. module random;    {29}
  2.  
  3. function random(dummy: integer): real;
  4.  
  5. { random number 0-1 }
  6.  
  7.         { DEFINE SEED=4.0 AS GLOBAL !!!!!!!! }
  8.  
  9. { adapted from HP-35 applications programs }
  10.  
  11. const
  12.  pi    = 3.14159;
  13.  
  14. var
  15.  x    : real;
  16.  i    : integer;
  17.  
  18. begin    { RANDOM }
  19.  x:=seed+pi;
  20.  x:=exp(5.0*ln(x));
  21.  seed:=x-trunc(x);
  22.  random:=seed
  23. end;        { RANDOM }
  24.  
  25. modend.
  26.